apiready = function () {
  api.parseTapmode();
  FastClick.attach(document.body);
  var header = $api.byId('aui-header');
  $api.fixStatusBar(header);
  var pageNoti = new Vue({
      el: '#pageNoti',
      data: {
        user_info:{},
        status:1,
      },
      created: function() {
         this.user_info = app.getUserInfo();
         this.load_user_app_msg_push();
      },
     methods: {
       load_user_app_msg_push:function(){
       var that = this;
       var systemType = api.systemType;
       var account = this.user_info.user_id+"_"+systemType;
       app.get("apiv2/user_app_msg_push/find",{
         account:account
       }, function (res) {
         if (res.code != 200) {
           app.alert(res.msg);
           return;
         }
         that.status = res.data.status;

       });
      },
        save_user_app_msg_push:function(){
          var post={};
          var status = $("#user_app_msg_push_status:checked").val();
          // alert(status);
          var systemType = api.systemType;
          var account = this.user_info.user_id+"_"+systemType;
          app.post("apiv2/user_app_msg_push/add",{
            user_id:this.user_info.user_id,
            store_id:this.user_info.store_id,
            app_account:account,
            platform:systemType,
            status:status?status:0,
          },function(res){
            if(res.code!=200){
               app.alert(res.msg);
            }
          });
        }

     }
  })
}
